<?php
if($_SESSION["session"]["key"] == "Supper Administrator" || $_SESSION["session"]["key"] == "Administrator" || $_SESSION["session"]["key"] == "Publisher" || $_SESSION["session"]["key"] == "Editor" || $_SESSION["session"]["key"] == "Author"){
include_once("com_content.process.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="robots" content="index, follow" />
	<title> Bảng điều khiển </title>
	
	<link href="css/icon.css" rel="stylesheet" type="text/css" />
	<link href="css/template.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="css/rounded.css" />
	
	<!--[if IE 7]>
	<link href="css/ie7.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	
	<!--[if lte IE 6]>
	<link href="css/ie6.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	
	<script language="javascript" src="javascript/javascript.js"></script>
	
	<script type="text/javascript" src="javascript/mootools.js"></script>
	<script type="text/javascript" src="javascript/menu.js"></script>
	<script type="text/javascript" src="javascript/index.js"></script>
	<script language="javascript" type="text/javascript" src="calendar/popcalendar.js"></script>
	<?php if( trim($GLOBALS['msg']) != "" ){ 
		echo "<script type=\"text/javascript\">alert('".$GLOBALS['msg']."');</script>"; 
	} ?>
	
</head>
<body id="minwidth-body">
<?php include("$com_folder/com_header/com_header.html.php");?>
<?php
	switch (trim($_GET["view"])) {	
	
		case "":
			include_once("404.php");
		break;
		
		case "session":
		
			$roles = $_SESSION["session"]["key"];
			
			switch ( $roles ) {
				
				case "Supper Administrator":
					
					switch (trim($_GET["task"])) {
				
						case "":
							include_once("session/com_content.session.view.admin.php");
						break;
				
						case "view":
						include_once("session/com_content.session.view.admin.php");
						break;
						
						case "add":
						include_once("session/com_content.session.add.admin.php");
						break;
						
						case "edit":
						include_once("session/com_content.session.edit.admin.php");
						break;
						
						default:
							include_once("session/com_content.session.view.admin.php");
						break;
					
					}
					
				break;
				
				case "Administrator":
				
					switch (trim($_GET["task"])) {
				
						case "":
							include_once("session/com_content.session.view.admin.php");
						break;
				
						case "view":
						include_once("session/com_content.session.view.admin.php");
						break;
						
						case "add":
						include_once("session/com_content.session.add.admin.php");
						break;
						
						case "edit":
						include_once("session/com_content.session.edit.admin.php");
						break;
						
						default:
							include_once("session/com_content.session.view.admin.php");
						break;
					
					}
					
				break;
				
				case "Publish":
				
					switch (trim($_GET["task"])) {
				
						case "":
							include_once("session/com_content.session.view.publish.php");
						break;
				
						case "view":
						include_once("session/com_content.session.view.publish.php");
						break;
						
						case "add":
						include_once("session/com_content.session.add.publish.php");
						break;
						
						case "edit":
						include_once("session/com_content.session.edit.publish.php");
						break;
						
						default:
							include_once("session/com_content.session.view.publish.php");
						break;
					
					}
					
				break;
				
				case "Editor":
				
					switch (trim($_GET["task"])) {
				
						case "":
							include_once("session/com_content.session.view.editor.php");
						break;
				
						case "view":
						include_once("session/com_content.session.view.editor.php");
						break;
						
						case "add":
						include_once("session/com_content.session.add.editor.php");
						break;
						
						case "edit":
						include_once("session/com_content.session.edit.editor.php");
						break;
						
						default:
							include_once("session/com_content.session.view.editor.php");
						break;
					
					}
					
				break;
			
			}
			
		break;
		
		case "category":
			
			$roles = $_SESSION["session"]["key"];
		
			switch ( $roles ) {
			
				case "Supper Administrator":
					
					switch (trim($_GET["task"])) {
			
						case "":
							include_once("category/com_content.category.view.admin.php");
						break;
		
						case "view":
						include_once("category/com_content.category.view.admin.php");
						break;
						
						case "add":
						include_once("category/com_content.category.add.admin.php");
						break;
						
						case "edit":
						include_once("category/com_content.category.edit.admin.php");
						break;
						
						default:
							include_once("category/com_content.category.view.admin.php");
						break;
						
					}
				
				break;
				
				case "Administrator":
					
					switch (trim($_GET["task"])) {
			
						case "":
							include_once("category/com_content.category.view.admin.php");
						break;
		
						case "view":
						include_once("category/com_content.category.view.admin.php");
						break;
						
						case "add":
						include_once("category/com_content.category.add.admin.php");
						break;
						
						case "edit":
						include_once("category/com_content.category.edit.admin.php");
						break;
						
						default:
							include_once("category/com_content.category.view.admin.php");
						break;
						
					}
				
				break;
				
				case "Publisher":
					
					switch (trim($_GET["task"])) {
			
						case "":
							include_once("category/com_content.category.view.publish.php");
						break;
		
						case "view":
						include_once("category/com_content.category.view.publish.php");
						break;
						
						case "add":
						include_once("category/com_content.category.add.publish.php");
						break;
						
						case "edit":
						include_once("category/com_content.category.edit.publish.php");
						break;
						
						default:
							include_once("category/com_content.category.view.publish.php");
						break;
						
					}
				
				break;
				
				case "Editor":
					
					switch (trim($_GET["task"])) {
			
						case "":
							include_once("category/com_content.category.view.editor.php");
						break;
		
						case "view":
						include_once("category/com_content.category.view.editor.php");
						break;
						
						case "add":
						include_once("category/com_content.category.add.editor.php");
						break;
						
						case "edit":
						include_once("category/com_content.category.edit.editor.php");
						break;
						
						default:
							include_once("category/com_content.category.view.editor.php");
						break;
						
					}
				
				break;
			}
				
			break;
			
		break;
		
		case "news":
		
		$roles = $_SESSION["session"]["key"];
			
			switch ( $roles ) {
				
				case "Supper Administrator":
					
					switch (trim($_GET["task"])) {
					
						case "":
							include_once("news/com_content.news.view.admin.php");
						break;
					
						case "view":
						include_once("news/com_content.news.view.admin.php");
						break;
						
						case "add":
						include_once("news/com_content.news.add.admin.php");
						break;
						
						case "edit":
						include_once("news/com_content.news.edit.admin.php");
						break;
						
						default:
							include_once("news/com_content.news.view.admin.php");
						break;
						
					}
					
				break;
				
				case "Administrator":
					
					switch (trim($_GET["task"])) {
					
						case "":
							include_once("news/com_content.news.view.admin.php");
						break;
					
						case "view":
						include_once("news/com_content.news.view.admin.php");
						break;
						
						case "add":
						include_once("news/com_content.news.add.admin.php");
						break;
						
						case "edit":
						include_once("news/com_content.news.edit.admin.php");
						break;
						
						default:
							include_once("news/com_content.news.view.admin.php");
						break;
						
					}
					
				break;
				
				case "Publisher":
					
					switch (trim($_GET["task"])) {
					
						case "":
							include_once("news/com_content.news.view.publish.php");
						break;
					
						case "view":
						include_once("news/com_content.news.view.publish.php");
						break;
						
						case "add":
						include_once("news/com_content.news.add.publish.php");
						break;
						
						case "edit":
						include_once("news/com_content.news.edit.publish.php");
						break;
						
						default:
							include_once("news/com_content.news.view.publish.php");
						break;
						
					}
					
				break;
				
				case "Editor":
					
					switch (trim($_GET["task"])) {
					
						case "":
							include_once("news/com_content.news.view.editor.php");
						break;
					
						case "view":
						include_once("news/com_content.news.view.editor.php");
						break;
						
						case "add":
						include_once("news/com_content.news.add.editor.php");
						break;
						
						case "edit":
						include_once("news/com_content.news.edit.editor.php");
						break;
						
						default:
							include_once("news/com_content.news.view.editor.php");
						break;
						
					}
					
				break;
				
				case "Author":
					
					switch (trim($_GET["task"])) {
					
						case "":
							include_once("news/com_content.news.view.author.php");
						break;
					
						case "view":
						include_once("news/com_content.news.view.author.php");
						break;
						
						case "add":
						include_once("news/com_content.news.add.author.php");
						break;
						
						case "edit":
						include_once("news/com_content.news.edit.author.php");
						break;
						
						default:
							include_once("news/com_content.news.view.author.php");
						break;
						
					}
					
				break;				
				
			}
				
		break;
		
		default:
			include_once("404.php");
		break;
	
	}
?>
<?php include("$com_folder/com_footer/com_footer.html.php");?>
</body>
</html>
<?php
} else {
	include("404.php");
	exit();
}
?>